package com.huawei.hms.framework.network.restclient.hwhttp.urlconnection;

import com.huawei.hms.framework.network.restclient.hianalytics.BaseRequestFinishedInfo;
import com.huawei.hms.framework.network.restclient.hianalytics.EditableMetrics;
import com.huawei.hms.framework.network.restclient.hianalytics.EditableMetricsTime;
import com.huawei.hms.framework.network.restclient.hwhttp.HttpContants;

public class URLConnRequestFinishedInfo extends BaseRequestFinishedInfo {
    private static final String TAG = "URLConnRequestFinishedInfo";
    private EditableMetrics metrics = new EditableMetrics();
    private EditableMetricsTime metricsRealTime = new URLConnMetricsTime(true);
    private EditableMetricsTime metricsTime = new URLConnMetricsTime(false);

    class URLConnMetricsTime extends EditableMetricsTime {
        URLConnMetricsTime(boolean z) {
            super(z);
        }

        public long getTotalTime() {
            return getAndCheckEndTime(getCallStartTime(), getCallEndTime()) - getCallStartTime();
        }

        public long getTtfb() {
            return 0;
        }
    }

    URLConnRequestFinishedInfo() {
    }

    public EditableMetricsTime getMetricsTime() {
        return this.metricsTime;
    }

    public EditableMetrics getMetrics() {
        return this.metrics;
    }

    public EditableMetricsTime getMetricsRealTime() {
        return this.metricsRealTime;
    }

    public String getNetworkSdkType() {
        return HttpContants.TYPE_URLCONNECTION;
    }
}
